package org.lx.nursing.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

@Data
@ApiModel("预约创建DTO")
public class ReservationDto {

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @ApiModelProperty(value = "手机号", required = true, example = "13211223569")
    private String mobile;

    @NotBlank(message = "预约人姓名不能为空")
    @ApiModelProperty(value = "预约人姓名", required = true, example = "李天天")
    private String name;

    @NotNull(message = "预约时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "预约时间", required = true, example = "2024-09-19 10:30:00")
    private LocalDateTime time;

    @NotNull(message = "预约类型不能为空")
    @ApiModelProperty(value = "预约类型 0-参观预约", required = true, allowableValues = "0", example = "0")
    private Integer type;

    @NotBlank(message = "探访人姓名不能为空")
    @ApiModelProperty(value = "家人姓名（老人姓名）", required = true, example = "李霸天")
    private String visitor;
}
